package com.socialuni.sdk.repository;


import com.socialuni.sdk.model.DO.user.UserFollowDetailDO;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.JpaRepository;

public interface UserFollowDetailRepository extends JpaRepository<UserFollowDetailDO, Integer> {

    @Cacheable(cacheNames = "findUserFollowByUserId")
    UserFollowDetailDO findByUserId(Integer userId);

    @CacheEvict(cacheNames = "findUserFollowByUserId", key = "#userFollowDetailDO.userId")
    UserFollowDetailDO save(UserFollowDetailDO userFollowDetailDO);
}

